package com.longy.desensitized.util.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.longy.desensitized.util.enums.DesensitizedType;
import com.longy.desensitized.util.filter.DesensitizedFilter;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/**
 * 脱敏注解
 *
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@JacksonAnnotationsInside
@JsonSerialize(using = DesensitizedFilter.class)
public @interface DesensitizationField {


    /**
     * 脱敏方式<br>
     *
     * <p>默认按名称脱敏
     */
    DesensitizedType type() default DesensitizedType.NAME;

}
